<template>
  <el-popconfirm
    confirm-button-text="删除"
    cancel-button-text="取消"
    title="你确定删除该条数据吗?"
    @confirm="confirmEvent"
    @cancel="cancelEvent"
  >
    <template #reference>
      <el-button type="danger">删除</el-button>
    </template>
  </el-popconfirm>
</template>

<script setup>
const emit = defineEmits(['deleteHandler'])
const confirmEvent = () => {
  emit('deleteHandler')
}
const cancelEvent = () => {
  console.log('cancel!')
}
</script>

<style lang="scss" scoped></style>
